//I will go in NOIP
//by SIP zhangle from Class 7,Grade 7
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
inline ll read()
{
    ll x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9')
    {
        if(ch=='-')f=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9')
    {
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    return x*f;
}
inline void write(ll x)
{
    if(x<0)
    {
        putchar('-');
        x=(~x)+1;
    }
    if(x>9)write(x/10);
    putchar(x%10+'0');
}
ll a[100005],b[100005],p;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    ll T=1,n,x,l,r,ans;
    //cin>>T;
    while(T--)
    {
        n=read();
        for(ll i=1;i<=n;i++)a[i]=read();
        ans=n;
        sort(a+1,a+n+1,greater<ll>());
        x=1;
        for(ll i=2;i<=n+1;i++)
        {
            if(a[i]==a[i-1])x++;
            else
            {
                b[++p]=i-1;
                x=1;
            }
        }
        l=b[p-1];
        r=n;
        while(l>=1)
        {
            if(a[l]>a[r])ans--,r--;
            l--;
        }
        write(ans);
    }
    return 0;
}
